<template>
  <section class="my-detail">
    <div class="item" v-for="item in list" :key="item">
      <div class="flex flex-between flex-middle">
        <div class="price">+{{item.cashAmt}}</div>
        <div class="order">订单：{{item.cashOrderId}}</div>
      </div>
      <div class="flex flex-between flex-middle">
        <div class="status" v-if="item.cashStatus ==1">状态：待审核</div>
        <div class="status" v-else-if="item.cashStatus ==2">状态：审核通过</div>
        <div class="status-" v-else-if="item.cashStatus ==3">状态：驳回</div>
        <div class="order">{{item.createTime}}</div>
      </div>
      <div class="reason" v-if="item.cashStatus ==3">失败原因：{{item.rejectReason}}</div>
    </div>
  </section>
</template>
<script>
export default {
  data() {
    return {
      list:''
    };
  },
  onLoad() {
    this.getCashDtl();
  },
  methods: {
    routerTo(url) {
      wx.navigateTo({ url });
    },
    getCashDtl(){
      this.$api.getCashDtl().then(res => {
        this.list = res.data.cashDtls.map(item=>{
          item.createTime = this.formatDate(item.createTime,"Y-M-D h:s");
          return item;
        })
      })
    }
  }
};
</script>
<style lang="scss" scoped>
.my-detail {
  .item {
    margin: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 1);
    border-radius: 5px;
    & > div:not(:last-child) {
      margin-bottom: 15px;
    }
    .status {
      font-size: 12px;
      font-family: PingFang;
      font-weight: 500;
      color: rgba(255, 156, 0, 1);
      line-height: 13px;
    }
    .status- {
      font-size: 12px;
      font-family: PingFang;
      font-weight: 500;
      color: rgba(59, 184, 253, 1);
      line-height: 13px;
    }
    .reason {
      font-size: 12px;
      font-family: PingFang;
      font-weight: 500;
      color: rgba(59, 184, 253, 1);
      line-height: 13px;
      background: rgba(233, 247, 255, 1);
      border-radius: 3px;
      padding: 5px 4px;
      display: inline-block;
    }
    .order {
      font-size: 12px;
      font-family: DIN;
      font-weight: 500;
      color: rgba(193, 196, 201, 1);
      line-height: 13px;
    }
    .price {
      font-size: 15px;
      font-family: DIN;
      font-weight: bold;
      color: rgba(46, 46, 46, 1);
      line-height: 13px;
    }
    .btn {
      width: 90px;
      height: 28px;
      border: 1px solid rgba(255, 255, 255, 1);
      border-radius: 14px;
      font-size: 12px;
      font-family: PingFang;
      font-weight: bold;
      color: rgba(255, 255, 255, 1);
      line-height: 28px;
      text-align: center;
      .icon {
        margin-right: 10px;
        margin-top: 3px;
      }
    }
  }
}
</style>
<style lang="scss">
page {
  background: #f7f7f7;
}
</style>